NYC Taxi data¶
Import cuXfilter¶
[1]:
from cuXfilter import charts
import cuXfilter
from bokeh import palettes
from cuXfilter.layouts import double_feature
from cuXfilter.assets.custom_tiles import get_provider, Vendors
[3]:
cux_df1 = cuXfilter.DataFrame.from_arrow('../../../data/nyc_taxi_1.arrow')
Define charts¶
[5]:
chart1 = charts.cudatashader.scatter_geo(x='dropoff_x',
y='dropoff_y',
aggregate_fn='count',
tile_provider=get_provider(Vendors.MAPBOX_DARK, access_token= MAPBOX_TOKEN), x_range=(-8239910.23,-8229529.24), y_range=(4968481.34,4983152.92))
chart2 = charts.bokeh.bar('passenger_count', data_points=9)
Create a dashboard object¶
[10]:
d1 = cux_df1.dashboard([chart1, chart2], layout=double_feature, theme=cuXfilter.themes.dark, title= 'NYC TAXI DATASET')
[11]:
#dashboard object
d1
[11]:
Starting the dashboard¶
d1.show(‘url you want the dashboard to run’) remote dashboard
d1.app(‘10.110.47.43:8888’) within the notebook: If you are using jupyter remotely, use this line instead of second, and replace url with current notebook url
[12]:
# preview
await d1.preview()
Export the queried data into a dataframe¶
[9]:
queried_df = d1.export()
no querying done, returning original dataframe